/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-11-09
 * Time: 20:09
 */
public class Test {
    public static void main(String[] args) {
        try {
            Class<?> c1 = Class.forName("reflectdemo.Student");

            Class c2 = Student.class;

            Student student = new Student();
            Class<?> c3 = student.getClass();

            //class对象只有一个
            System.out.println(c1.equals(c2));
            System.out.println(c1.equals(c3));
            System.out.println(c2.equals(c3));

        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
    public static void main1(String[] args) {
        char[] ch=new char[]{'a','b','c'};
        String s1=new String(ch);
        s1.intern();
        String s2="abc";
        System.out.println(s1 == s2);//返回true
    }
}
